# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=binflow
pkgver=5.7fb02a9
pkgrel=1
groups=('blackarch' 'blackarch-binary' 'blackarch-debugger')
pkgdesc='POSIX function tracing. Much better and faster than ftrace.'
arch=('x86_64' 'aarch64')
url='https://github.com/elfmaster/binflow'
license=('custom:unknown')
depends=('glibc' 'linux-headers' 'capstone')
makedepends=('git')
source=("git+https://github.com/elfmaster/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

#prepare() {
#  cd "$srcdir/binflow"

#  sed -i 's|capstone/libcapstone.a|/usr/lib/libcapstone.a|' Makefile
#}

build() {
  cd $pkgname

  mv capstone-2.1.2 capstone
  cd capstone
  make
  cd ..
  make
}

package() {
  cd $pkgname

  install -Dm 755 $pkgname "$pkgdir/usr/bin/$pkgname"
}

